import request from '@/axios'

function formatRequestUri(name) {
  return 'flow/audit/sign/file/' + name
}

export function Add(data) {
  return request.post({
    url: formatRequestUri('Add'),
    data
  })
}
export function AddLog(data) {
  return request.post({
    url: formatRequestUri('AddSignLog'),
    data
  })
}

export function Gets(logId) {
  return request.get({
    url: formatRequestUri('Gets'),
    params: {
      logId
    }
  })
}

export function Delete(id) {
  return request.get({
    url: formatRequestUri('Delete'),
    params: {
      id
    }
  })
}

export function SetImgUri(id, data) {
  return request.post({
    url: formatRequestUri('SetImgUri'),
    data: {
      Id: id,
      Value: data
    }
  })
}

export function Accredit(logId, fileId) {
  return request.get({
    url: formatRequestUri('Accredit'),
    params: {
      logId: logId,
      fileId: fileId
    }
  })
}
